package q94_inorderTraversal;

import CommonClass.Common.TreeNode;

import java.util.ArrayList;
import java.util.List;

public class Solution_1 {
    public static void main(String[] args) {
        TreeNode t = new TreeNode();
        Solution_1 s = new Solution_1();
        List<Integer> res = s.inorderTraversal(t);
        System.out.println(res);
    }

    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> res = new ArrayList<Integer>();
        searchLeft(root, res);
        return res;
    }

    public void searchLeft(TreeNode root, List<Integer> res) {
        if (root == null) {
            return;
        }
        searchLeft(root.left, res);
        res.add(root.val);
        searchLeft(root.right, res);

    }
}
